package com.yan.ems.pojo.vo;

import com.yan.ems.constant.RespCode;
import lombok.Data;

@Data
public class Result<T> {
	private Integer code;
	private String msg;
	private T data;
	public static <T> Result<T> success(T data) {
		Result<T> result = new Result<T>();
		result.setCode(RespCode.SUCCESS.getCode());
		result.setMsg(RespCode.SUCCESS.getMsg());
		result.setData(data);
		return result;
	}

	public static <T> Result<T> error() {
		Result<T> result = new Result<T>();
		result.setCode(RespCode.FAIL.getCode());
		result.setMsg(RespCode.FAIL.getMsg());
		return result;
	}
}
